package 笔试.快手;

/**
 * @author:谢君臣
 * @Date:2021/9/11-17:58
 * @version:1.0
 * @function:
 */
public class Main01 {
    public static void main(String[] args) {

    }
    public int bitCounter (int num) {
        // write code here
        String s = Integer.toBinaryString(num);
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i)=='1')count++;
        }
        return count;
    }
}
